package com.java.dormitorymanager.service.impl;

import com.java.dormitorymanager.dao.IStudentDao;
import com.java.dormitorymanager.impl.StudentDaoImpl;
import com.java.dormitorymanager.pojo.Student;
import com.java.dormitorymanager.service.IStudentService;

import java.util.List;

/**
 * @program: DormitoryManager
 * @description: IStudentService的实现类
 * @author: ShuangChenYue
 * @create: 2021-05-16 18:16
 **/
public class StudentServiceImpl implements IStudentService
{
    IStudentDao studentDao = new StudentDaoImpl();

    @Override
    public void studentRegister(Student student)
    {
        studentDao.studentRegister(student);
    }

    @Override
    public List<Student> findAllMaleStudents()
    {
        return studentDao.findAllMaleStudents();
    }

    @Override
    public List<Student> findAllFemaleStudents()
    {
        return studentDao.findAllFemaleStudents();
    }

    @Override
    public Student findStudentByName(String name)
    {
        return studentDao.findStudentByName(name);
    }

    @Override
    public Student findStudentById(int id)
    {
        return studentDao.findStudentById(id);
    }

    @Override
    public void deleteStudentById(int id)
    {
        studentDao.deleteStudentById(id);
    }

    @Override
    public void updateStudent(Student student)
    {
        studentDao.updateStudent(student);
    }

    @Override
    public List<Student> findAllMaleStudentsWithoutDorm()
    {
        return studentDao.findAllMaleStudentsWithoutDorm();
    }

    @Override
    public List<Student> findAllFemaleStudentsWithoutDorm()
    {
        return studentDao.findAllFemaleStudentsWithoutDorm();
    }
}
